def. is a category where its objects are sets, and morphisms are standard functions. Consider the following objects:
- Empty set: . You can have morphism .
- You can define morphism from void to any object.
- Singleton set: . You can have morphism from unit to anything, and anything to unit.
- , always returns .
- ! This is like generating elements without looking at the elements of the codomain set. Great abstraction!
Category Theory Definition
def. Terminal (=Unit) Object. ”” is a unit object iff both:
- …
- i.e. there is one unique arrow arriving from every object to ””, then is a terminal.
- This is terminal because all arrows end that the terminal object.
- This is equivalent to a singleton set in set theory. def. Initial (=Void) Object. is a initial object iff:
- This is initial because all arrows start from that initial object.
- This is equivalent to empty set in set theory.